<script setup lang="ts">
  import { onLaunch } from '@dcloudio/uni-app';
  import { useUserStore } from '@/store/modules/user';
  import { getToken } from '@/utils/auth';

  const userStore = useUserStore();
  onLaunch(async () => {
    if (getToken()) {
      console.log('有token');
      await userStore.loadUserInfo(false);
    } else {
      console.log('没有token');
      userStore.resetState(true);
    }
  });
</script>
<style>
  page,
  body {
    background: linear-gradient(180deg, #e3ebff 0%, #fcfdff 100%);
    min-height: 100%;
    background-attachment: fixed;
  }

  /* #ifdef H5 */
  /* 隐藏H5的滚动条  */
  html {
    overflow-x: hidden;
  }
  body::-webkit-scrollbar {
    display: none;
  }
  /* #endif */
</style>
